﻿<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
-->

<ResourceDictionary
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:toolkit="clr-namespace:System.Windows.Controls"
  xmlns:toolkitPrimitives="clr-namespace:System.Windows.Controls.Primitives"
  xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows">

    <Style TargetType="toolkitPrimitives:GlobalCalendarButton">
        <Setter Property="Background" Value="#FFBADDE9" />
        <Setter Property="FontSize" Value="10" />
        <Setter Property="HorizontalContentAlignment" Value="Center" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="MinWidth" Value="40" />
        <Setter Property="MinHeight" Value="42" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="toolkitPrimitives:GlobalCalendarButton">
                    <Grid>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition GeneratedDuration="0:0:0.1" />
                                </vsm:VisualStateGroup.Transitions>
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation
                                          Storyboard.TargetName="Background"
                                          Storyboard.TargetProperty="Opacity"
                                          To=".5"
                                          Duration="0" />
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimation
                                          Storyboard.TargetName="Background"
                                          Storyboard.TargetProperty="Opacity"
                                          To=".5"
                                          Duration="0" />
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="SelectionStates">
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition GeneratedDuration="0" />
                                </vsm:VisualStateGroup.Transitions>
                                <vsm:VisualState x:Name="Unselected" />
                                <vsm:VisualState x:Name="Selected">
                                    <Storyboard>
                                        <DoubleAnimation
                                          Storyboard.TargetName="SelectedBackground"
                                          Storyboard.TargetProperty="Opacity"
                                          To=".75"
                                          Duration="0" />
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="ActiveStates">
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition GeneratedDuration="0" />
                                </vsm:VisualStateGroup.Transitions>
                                <vsm:VisualState x:Name="Active" />
                                <vsm:VisualState x:Name="Inactive">
                                    <Storyboard>
                                        <ColorAnimation
                                          Storyboard.TargetName="ContentBrush"
                                          Storyboard.TargetProperty="Color"
                                          To="#FF777777"
                                          Duration="0" />
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="CalendarButtonFocusStates">
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition GeneratedDuration="0" />
                                </vsm:VisualStateGroup.Transitions>
                                <vsm:VisualState x:Name="CalendarButtonFocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                          Storyboard.TargetName="FocusVisual"
                                          Storyboard.TargetProperty="Visibility"
                                          Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="CalendarButtonUnfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames
                                          Storyboard.TargetName="FocusVisual"
                                          Storyboard.TargetProperty="Visibility"
                                          Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>

                        <Rectangle
                          x:Name="SelectedBackground"
                          RadiusX="1"
                          RadiusY="1"
                          Opacity="0"
                          Fill="{TemplateBinding Background}" />
                        <Rectangle
                          x:Name="Background"
                          RadiusX="1"
                          RadiusY="1"
                          Opacity="0"
                          Fill="{TemplateBinding Background}" />

                        <ContentControl
                          IsTabStop="False"
                          Content="{TemplateBinding Content}"
                          ContentTemplate="{TemplateBinding ContentTemplate}"
                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                          FontSize="{TemplateBinding FontSize}"
                          Margin="1,0,1,1">
                            <ContentControl.Foreground>
                                <SolidColorBrush x:Name="ContentBrush" Color="#FF333333" />
                            </ContentControl.Foreground>
                        </ContentControl>

                        <Rectangle
                          x:Name="FocusVisual"
                          Visibility="Collapsed"
                          IsHitTestVisible="false"
                          RadiusX="1"
                          RadiusY="1"
                          Stroke="#FF6DBDD1" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>